﻿/** 
 *  页面加载等待页面 
 * 
 * @author ws 
 * @date 2012/8/8 
 * 
 */  
// var height = window.screen.height-250;  
// var width = window.screen.width;  
// var leftw = 300;  
// if(width>1200){  
//    leftw = 500;  
// }else if(width>1000){  
//    leftw = 350;  
// }else {  
//    leftw = 100;  
// }

//var _html = "<div id='loading' style='position:absolute;left:0;width:100%;height:" + height + "px;top:0;background:#e0ecff;opacity:0.8;filter:alpha(opacity=80);'>  " +
//	        "     <div style='position:absolute;  cursor1:wait;left:"+leftw+"px;top:200px;width:auto;height:16px;padding:12px 5px 10px 30px; background:#fff url(/wlzl/js/themes/default/images/pagination_loading.gif) no-repeat scroll 5px 10px;border:2px solid #ccc;color:#000;'>"+
//	 	    "        正在加载，请等待..."+
//	        "     </div>"+
//            " </div>";  
   
// window.onload = function(){  
//    //var _mask = document.getelementbyid('loading');  
//    //_mask.parentnode.removechild(_mask);  
// }  
  
       
// document.write(_html);  
 

//截取空格
String.prototype.trim = function () {
    return this.replace(/(^\s*)|(\s*$)/g, '');
};

function closethistab(tabname) {
    parent.$.messager.confirm('系统提示', '提示：确定要关闭当前页面吗？', function (r) {
        if (r) {
            parent.CloseTabByTitle(tabname);
        }
    });
}
function unLockState() {
    parent.$.extend(parent.$.messager.defaults, {
        ok: "去解锁",
        cancel: "取消"
    });
    parent.$.messager.confirm('系统提示', '提示：当前帐套已锁定，请先解锁帐套！', function (r) {
        if (r) {
            parent.childAddTab('历史盘点', '/StoreReserve/List/', '慧管货');
        }
    });
    parent.$.extend(parent.$.messager.defaults, {
        ok: "确定",
        cancel: "取消"
    });
}
function showSnList() {
    $(".sn").hover(function () {
        //$(this).css("position", "absolute");
        $(this).find('.snList').show();

    }, function () {
        $(this).find('.snList').hide();
        //$(this).css("position", "inherit");
    });
    //$(".snList").hover(function () {
    //    $(this).show();
    //}, function () {
    //    $(this).hide();
    //});
}

function noLockChoose() {
    parent.$.extend(parent.$.messager.defaults, {
        ok: "解锁",
        cancel: "取消"
    });
    parent.$.messager.confirm('系统提示', '您需要先解锁帐套才能进行该业务操作。', function (r) {
        if (r) {
            parent.childAddTab('历史盘点', '/StoreReserve/List/', '慧管货');
        }
    });
    parent.$.extend(parent.$.messager.defaults, {
        ok: "确定",
        cancel: "取消"
    });
}

// 0=期初，1=进货，2=进货退货，3=销售，4=销售退货，5=盘点，6=组装拆卸,7=调拨,
// 8=借入,9=借出,10=借入归还,11=借出归还,12=借出转销售,13=借入转进货,14=待入库单,15=待出库单,16=入库单,17=出库单
function ShowBillDetail(busiType, busiId) {
    switch (busiType) {
        case 1:
            parent.childAddTab("进货单据明细", "/Buy/Edit?BuyId=" + busiId, '慧管货');
            break;
        case 2:
            parent.childAddTab("进货退货单据明细", "/BuyReturn/Edit?ReturnId=" + busiId, '慧管货');
            break;
        case 3:
            parent.childAddTab("销售单据明细", "/Sale/Edit?SaleId=" + busiId, '慧管货');
            break;
        case 4:
            parent.childAddTab("销售退货单据明细", "/SaleReturn/Edit?ReturnId=" + busiId, '慧管货');
            break;
        case 5:
            parent.childAddTab("历史盘点单", "/StoreReserve/Edit?TakBillId=" + busiId, '慧管货');
            break;
        case 6:
            parent.childAddTab("组装拆卸单据明细", "/Assembly/Detail?id=" + busiId, '慧管货');
            break;
        case 7:
            parent.childAddTab("调拨明细", "/Transfer/Edit?TranId=" + busiId, '慧管货');
            break;
        case 8:
            parent.childAddTab("借入明细", "/Borrow/Edit?LendId=" + busiId, '慧管货');
            break;
        case 9:
            parent.childAddTab("借出明细", "/Lend/Edit?LendId=" + busiId, '慧管货');
            break;
        case 10:
            parent.childAddTab("借入归还明细", "/Borrow/ReturnEdit?ReturnId=" + busiId, '慧管货');
            break;
        case 11:
            parent.childAddTab("借出归还明细", "/Lend/ReturnEdit?ReturnId=" + busiId, '慧管货');
            break;
        case 12:
            parent.childAddTab("借出转销售明细", "/Sale/Edit?SaleId=" + busiId, '慧管货');
            break;
        case 13:
            parent.childAddTab("借入转进货明细", "/Buy/Edit?BuyId=" + busiId, '慧管货');
            break;
        case 16:
            parent.childAddTab("入库单明细", "/InStorage/Edit?IOId=" + busiId, '慧管货');
            break;
        case 17:
            parent.childAddTab("出库单明细", "/OutStorage/Edit?IOId=" + busiId, '慧管货');
            break;
        default:

    }
    
}
